//
//  AISetBalanceListCell.m
//  Mia
//
//  Created by Vill on 2024/1/13.
//

#import "AISetBalanceListCell.h"

@interface AISetBalanceListCell ()

@property (weak, nonatomic) IBOutlet UIView *balanceContain;

@property (weak, nonatomic) IBOutlet UIButton *rechargeBtn;

@property (weak, nonatomic) IBOutlet UILabel *balanceLbl;

@end

@implementation AISetBalanceListCell

+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *ID = @"AISetBalanceListCell";
    AISetBalanceListCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell == nil){
       cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].lastObject;
    }
    return cell;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.balanceContain.layer.cornerRadius = PTW(27);
    self.balanceContain.layer.masksToBounds = YES;
    
    self.rechargeBtn.titleLabel.font = [UIFont fontWithWeight:MTBold size:PTW(17)];
    self.rechargeBtn.backgroundColor = [UIColor colorHex:@"#EFEFEF"];
    self.rechargeBtn.layer.cornerRadius = PTW(43)/2;
    self.rechargeBtn.layer.shadowColor = [UIColor colorHex:@"#FFFFFF" alpha:0.68].CGColor;
    self.rechargeBtn.layer.shadowOffset = CGSizeMake(0,0);
    self.rechargeBtn.layer.shadowOpacity = 1;
    self.rechargeBtn.layer.shadowRadius = 20;
    self.rechargeBtn.userInteractionEnabled = NO;
    
    AIUserInfoModel *model = [[AIUserInfoManager shareManager] userInfo];
    self.balanceLbl.text = [NSString stringWithFormat:@"%ld",(long)model.coinBalance];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
